package com.wenlin.myproduction.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author 文琳_377979485@qq.com
 * @time 2021/10/18 0018 上午 10:09
 * @desc 选择班次弹窗中选择了班次，返回给自定义控件的参数类
 */
public class RosterSelectWithChangeBean implements Parcelable {
    private RosterSelectBean bean;
    private boolean change;

    public RosterSelectWithChangeBean(RosterSelectBean bean, boolean change) {
        this.bean = bean;
        this.change = change;
    }

    public RosterSelectBean getBean() {
        return bean;
    }

    public void setBean(RosterSelectBean bean) {
        this.bean = bean;
    }

    public boolean isChange() {
        return change;
    }

    public void setChange(boolean change) {
        this.change = change;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.bean, flags);
        dest.writeByte(this.change ? (byte) 1 : (byte) 0);
    }

    public void readFromParcel(Parcel source) {
        this.bean = source.readParcelable(RosterSelectBean.class.getClassLoader());
        this.change = source.readByte() != 0;
    }

    protected RosterSelectWithChangeBean(Parcel in) {
        this.bean = in.readParcelable(RosterSelectBean.class.getClassLoader());
        this.change = in.readByte() != 0;
    }

    public static final Creator<RosterSelectWithChangeBean> CREATOR = new Creator<RosterSelectWithChangeBean>() {
        @Override
        public RosterSelectWithChangeBean createFromParcel(Parcel source) {
            return new RosterSelectWithChangeBean(source);
        }

        @Override
        public RosterSelectWithChangeBean[] newArray(int size) {
            return new RosterSelectWithChangeBean[size];
        }
    };
}
